"""
example06 - 格式化输出

Author: Administrator
Date: 2024/1/2
"""

a = float(input('a = '))
b = float(input('b = '))

print('%f + %f = %f' % (a, b, a + b))
print('%f - %f = %f' % (a, b, a - b))
print('%f * %f = %f' % (a, b, a * b))
print('%f / %f = %f' % (a, b, a / b))
print('%f // %f = %f' % (a, b, a // b))
print('%f %% %f = %f' % (a, b, a % b))
print('%f ** %f = %f' % (a, b, a ** b))

print('%.1f + %.1f = %.1f' % (a, b, a + b))
print('%.2f - %.2f = %.2f' % (a, b, a - b))
print('%.3f * %.3f = %.3f' % (a, b, a * b))
print('%.3f / %.3f = %.3f' % (a, b, a / b))

print(f'{a} + {b} = {a + b:.1f}')
print(f'{a} - {b} = {a - b:.2f}')
print(f'{a} * {b} = {a * b:.3f}')
print(f'{a} / {b} = {a / b:.4f}')